import { useSelector } from "react-redux";
import { StateType } from "../store";
import { ComponentsStateType } from "../store/userReducer";
function useGetComponentinfo() {
  const components = useSelector<StateType>((state) => state.components);
  const { componentList = [], selectedId, copiedComponent } = components;
  const selectComponent = componentList.find((item) => item.fe_id === selectedId);
  return {
    componentList,
    selectedId,
    selectComponent,
    copiedComponent,
  };
}
export default useGetComponentinfo;
